<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:set name="status_name" value="%{@com.japp.tools.common.SelectVal@planStatus(status)}"></s:set>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><s:property value="status_name"/></title>
<s:include value="/app_common/common.jsp"></s:include>
<!-- 日期选择框start -->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/form/datePicker/WdatePicker.js"></script>
<!-- 日期选择框end -->
<!--数字分页start-->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/nav/pageNumber.js"></script>
<!--数字分页end-->
</head>
<body>
<form name="form1" id="form1" action="<s:property value='webctx'/>/plan/en_queryEngageIn.action" target="frmrightChild" method="post">
<div class="box2" panelTitle="功能面板">
	<fieldset>
		<legend>经营预算计划查询</legend>
		<table class="noclass" style="width: 100%" >
			<tr>
				<td>提交人编码：</td>
				<td><input type="text" name="en.en_submit_ucode" value="<s:property value='en.en_submit_ucode'/>"/></td>
				<td>提交人名称：</td>
				<td><input type="text" name="en.en_submit_uname" value="<s:property value='en.en_submit_uname'/>"/></td>
				<td>提交时间:</td>
				<td><input type="text" name="en.en_submit_date" value="<s:property value='en.en_submit_date'/>" class="date" style="cursor: pointer;" ></td>
				<td>所属部门:</td>
				<td><select name="en.en_submit_dpid" selectedValue="<s:property value='en_submit_dpid'/>" prompt="请选择" data='<s:property value="json_val"/>'></select></td>
			</tr>
			<tr>
				<td colspan="10" align="center">
					<button type="button" onclick="resets()"><span class="icon_reload">重置</span></button>&nbsp;
					<button type="button" onclick="search()"><span class="icon_find">查询</span></button>
				</td>
			</tr>
		</table>
	</fieldset>
</div>
<div class="box_tool_min padding_top2 padding_bottom2 padding_right5">
	<div class="center">
		<div class="left">
			<div class="right">
				<div class="padding_top5 padding_left10">
					<a href="javascript:;" onclick="onInsert()" target="frmrightChild"><span class="icon_add">新增经营计划(日)</span></a>
					<div class="box_tool_line"></div>
					<a href="javascript:;" onclick="onDelete(null)" target="frmrightChild"><span class="icon_delete">批量删除</span></a>
					<!-- 
					<div class="box_tool_line"></div>
					<a href="javascript:;" onclick="importEngageIn()"><span class="icon_import">导入</span></a>
					<div class="box_tool_line"></div>
					<a href="javascript:;" onclick="exportEngageIn()"><span class="icon_export">导出当前页</span></a>
					<div class="box_tool_line"></div>
					<a href="javascript:;"  onclick="exportEngageIn2()"><span class="icon_export">导出全部</span></a> -->
					<div class="clear"></div>
				</div>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="scrollContent" >
	<table class="tableStyle" id="tableA" useClick="false" headFixMode="true" useCheckBox="true" sortMode="true">
		<tr>
			<th width="25"></th>
			<th>提交时间</th>
			<th>提交人名称</th>
			<th>部门名称</th>
			<th>收入计划合计</th>
			<th>营业费用计划合计</th>
			<th>营业利润计划合计</th>
			<th>可控费用计划合计</th>
			<th width="70">操作</th>
		</tr>
		<s:iterator value="page.result" status="stat">
		<tr ondblclick="onView(<s:property value="en_id"/>)">
			<td width="25"><input name="keys" type="checkbox" value="<s:property value="en_id"/>" /></td>
			<td><s:property value="en_submit_date.substring(0,10)"/></td>
			<td><s:property value="en_submit_uname"/></td>
			<td><s:property value="en_submit_dpname"/></td>
			<td><s:property value="en_sum_srjh"/></td>
			<td><s:property value="en_plan_yyf"/></td>
			<td><s:property value="en_plan_lr"/></td>
			<td><s:property value="en_plan_kkfy"/></td>

			<td width="70">
				<span class="img_view hand" title="查看" onclick="onView(<s:property value="en_id"/>)"></span>
				<span class="img_edit hand" title="修改" onclick="onEdit(<s:property value="en_id"/>)"></span>
				<span class="img_delete hand" title="删除" onclick="onDelete(<s:property value="en_id"/>)"></span>
			</td>
		</tr>
		</s:iterator>
	</table>
</div>
<!-- 分页 -->
<div style="height:35px;">
	<div class="float_left padding5">共查询<s:property value='total'/>条数据</div>
	<div class="float_right padding5">
		<div class="pageNumber" total="<s:property value='total'/>" page="<s:property value='currentPage-1'/>" pageSize="<s:property value='size'/>" showSelect="true" showInput="true" id="page"></div>
	</div>
	<div class="clear"></div>
</div>
<s:hidden name="currentPage"/>
<s:hidden name="size"/>
</form>
</body>
<script type="text/javascript">
//分页事件
$("#page").bind("pageChange",function(e,index){
	$('#currentPage').val(index+1);
	showProgressBar();
	document.form1.submit();
}).bind("sizeChange",function(e,num){
	$('#size').val(num);
	showProgressBar();
	document.form1.submit();
});
//搜索
function search(){
	showProgressBar();
	document.form1.submit();
}
//重置
function resets(){
	$('.noclass input').val('');
	
	$('select').each(function(){
		$(this).children('option:eq(0)').attr('selected',true);
	});
}
//查看diag.innerFrame.contentWindow.document.getElementById('a')
function onView(obj){
	showProgressBar();
	window.parent.frmrightChild.location = webctx+"/plan/en_findEngageInView.action?en.en_id="+obj;
	//top.Dialog.open({URL:webctx+"/summary/en_findEngageInView.action?en.en_id="+obj,Title:"总结信息查看",Width:550,Height:400}); 
}
//新增
function onInsert(){
	showProgressBar();
	window.parent.frmrightChild.location = webctx+"/plan/en_findEngageInDetil.action?en.en_id=0";
	//top.Dialog.open({URL:webctx+"/summary/en_findEngageInDetil.action?en.en_id=0",Title:"总结信息新增",Width:550,Height:450});
}
//修改
function onEdit(obj){
	showProgressBar();
	window.parent.frmrightChild.location = webctx+"/plan/en_findEngageInDetil.action?en.en_id="+obj;
	//top.Dialog.open({URL:webctx+"/summary/en_findEngageInDetil.action?en.en_id="+obj,Title:"总结信息更新",Width:550,Height:450});
}
//删除
function onDelete(obj){
	top.Dialog.confirm("确定要删除该记录吗？",function(){
		var actionUrl;
		//单个删除
		var actionData = "rnd:"+Math.random();
		if(obj!=null){
			actionUrl = webctx+"/plan/en_deleteEngageInById.action?keys="+obj;
		}else {
			if($('input[name="keys"]:checked').length==0){
				top.Dialog.alert("请选择需要删除的团队总结!");
				return false;
			}
			actionUrl = webctx+"/plan/en_deleteEngageInById.action";
			actionData = $("#form1").serialize();
		}
		showProgressBar();
		$.ajax({
			url:actionUrl,
			data:actionData,
			type : "post",
			cache : false,
			dataType : 'text',
			success : function(data) {
				alert(data);
				closeProgress();
				if(data.indexOf('失败')!=-1)return false;
				document.form1.action = webctx+"/plan/en_queryEngageIn.action";
				document.form1.submit();
			}
		});
	});
}

</script>
</html>